package com.dxy.lc.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author dxy
 * @since 2024-11-07
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("t_message")
public class Message {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private Integer roomId;

    // 1-文本，2-图片，3-音频，4-视频，5-附件，6-链接，7-其他
    private Integer msgType;

    private String content;

    private LocalDateTime sentAt;

    private Integer sentBy;

    private String extData;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT)
    private Integer createdBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updatedBy;

    // 0-未读，1-已读
    @TableField(exist = false)
    private Integer status;

    @TableField(exist = false)
    private LocalDateTime readAt;

    @TableField(exist = false)
    private String sentByName;

}
